<?php
$id = $_GET['id'];
$shopcode = 'shop' . $id;
if (isset(Yii::app()->request->cookies[$shopcode]->value)) {
    $shoparry = Yii::app()->request->cookies[$shopcode]->value;
    $savedCardArray = json_decode($shoparry, true);
}

$baner = ShopPanel::model()->findAll(
        array(
            'condition' => ' `flag`=1 and `type`=0 ',
            'limit' => 2,
        )
);
if (!empty($baner)) {
    $lan = 0;
    foreach ($baner as $b) {
        $lan = $lan + 1;
        if ($lan < 2) {
            ?>
            <div id="ad_global_below_navbar"><div class="rightleftads" style="position: fixed; top: 74px; left: 10px; z-index: 1; display: block;">
                    <a href="<?php echo $b->url; ?>" target="_blank" rel="nofollow"><img title="<?php echo $b->name; ?>" src="<?php echo 'http://www.salesmartlink.com/upload/quangcao/' . $b->photo; ?>" width="180" height="550" alt="<?php echo $b->name; ?>" border="0"></a>
                </div>
            <?php } else { ?>
                <div class="rightleftads" style="position: fixed; top: 74px; right: 10px; z-index: 1; display: block;">
                    <a href="<?php echo $b->url; ?>" target="_blank" rel="nofollow"><img src="<?php echo 'http://www.salesmartlink.com/upload/quangcao/' . $b->photo; ?>" width="180" height="550" alt="<?php echo $b->name; ?>" border="0" title="<?php echo $b->name; ?>"></a>
                </div>

                <?php
            }
        }
    }
    ?>

    <script type="text/javascript">
        <!--
                   function rightleftads() {
            if (1210 >= $(window).width()) {
                $('.rightleftads').hide();
            }
            else {
                $('.rightleftads').show();
            }
        }
        $(window).resize(function() {
            rightleftads();
        });
        rightleftads();
//-->
    </script></div>